import { Component } from 'react'
import Taro from '@tarojs/taro'
import { View,Image} from '@tarojs/components'
import Styles from './index.module.less'

export default function index(props)
{

    const handleItemClick = (name) => {
        Taro.setStorageSync('selectedTreatment',name);
        Taro.navigateTo({
            url:'/pages/detail/index'
        })
    }

    const {image,name,mins,price} = props;
    return (
        <view className={Styles.goods_wrap} onClick={()=>{
            handleItemClick(name);
        }}>
            <Image src={image} class={Styles.img}/>
            <view class={Styles.info}>
                <view class={Styles.top}>{name}</view>
                <view class={Styles.bottom}>
                    <text class={Styles.price}>￥{price}</text>
                    <text class={Styles.mins}>时间：{mins}分钟</text>
                </view>
            </view>
        </view>
    )
}

